<?php

namespace App\Http\Middleware;
use Closure;

class Activity {
    /**
     * 前置操作
     * @param $request
     * @param Closure $next
     * @return \Illuminate\Http\RedirectResponse|\Illuminate\Routing\Redirector
     */
    public function handle($request, Closure $next) {
        if (time() < strtotime('2018-10-05')) {
            return redirect('activity');
        };
        return $next($request);

    }

    /**
     * 描述 : 后置操作
     * 作者 : gxh
     * @param $request
     * @param Closure $next
     */
    public function handlebak($request, Closure $next) {
        $response = $next($request);
        var_dump($response);
        echo 'after';exit;

    }
}
